

	<div class="navbar navbar-default navbar-fixed-top" style="background-color:#144264;" role="navigation">
      <div class="container">
        <div class="navbar-collapse collapse">
          <ul class="nav navbar-nav">
	      <li><a href="{% url 'users:index' %}"><b><i class="icon-home"></i> 首页</b></a></li>
	      <li><a href="{% url 'courses:types' %}"><b><i class="icon-book"></i> 课程</b></a></li>
	      <li><a href="{% url 'groups:groups' %}"><b><i class="icon-group"></i> 小组</b></a></li>
	      <li><a href="{% url 'rewards:rewards' %}"><b><i class="icon-money"></i> 悬赏</b></a></li>
	    </ul>
	    	<a style="margin-left:10%;color:white" class="navbar-brand" href="{% url 'users:index' %}"><strong>麦知</strong></a>
          <ul class="nav navbar-nav navbar-right">
            <li style="margin-top:13px" class="form-inline">
            	<!-- 搜索 -->
                <form action="/search" >
                <div class="form-group pull-left">
				    <input type="text" class="form-control" id="search" style="background-color:#D0D0E6;height:25px;width:170px" placeholder="搜索内容" onfocus="f()" onblur="b()">
				</div>
				<div class="form-group pull-left">
				    <button class="btn btn-info btn-sm form-control" style="height:25px;" type="submit"><i class="icon-search"></i></button>
				</div>
                </form>

				<div class="clearfix"></div>
            </li>
            <li><a id="selectPartner" href="javascript:void(0)" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-bell-alt"></i>{% ifequal havent 0 %}<span></span>{% else %}<span class="badge" id="havent">{{havent}}</span>{% endifequal %}</a>
            		<ul class="dropdown-menu">
            			{% for k in message %}
		                <li><a href="javascript:void(0)" onclick="mes_read({{k.2}});"><b>{{k.0}}</b>给您发了一条私信 : <div style="width:200px;overflow:hidden;text-overflow:ellipsis;"><i>{{k.1}}</i></div><!--<span><a href='#'>回复</a></span>--></a></li>
		             {% endfor %}
		                <li><a href="{% url 'users:mes' %}"><span style="font-size:12px;margin-left:20px;">查看全部私信 >></span></a><hr/></li>

		                {% for m in waningMes %}
		                <li>
		                	{% ifequal m.4 1 %}
		                	<a href="javascript:void(0)" onclick="read(1,{{m.6}},{{m.2}},0);">{{m.1}}揭榜您的悬赏<b>{{m.3}}</b></a>
		                	{% endifequal %}

							{% ifequal m.4 2 %}
		                	<a href="javascript:void(0)" onclick="read(2,{{m.6}},{{m.2}},0);">{{m.1}}购买您的课程<b>{{m.3}}</b></a>
		                	{% endifequal %}

		                	{% ifequal m.4 3 %}
		                	<!--{% url 'users:index' %}?page=2#news_{{m.2}}-->
		                	<a href="javascript:void(0)" onclick="news_page({{m.2}},{{m.6}});">{{m.1}}在<b>{{m.3}}</b>中回复了您</a>
		                	{% endifequal %}

		                	{% ifequal m.4 4 %}
		                	<a href="javascript:void(0)" onclick="reOfTopic_page({{m.5}},{{m.2}},{{m.6}});">{{m.1}}在<b>{{m.3}}</b>中回复了您</a>
		                	{% endifequal %}

		                	{% ifequal m.4 5 %}
		                	<a href="javascript:void(0)" onclick="news_page({{m.2}},{{m.6}})">{{m.1}}在<b>{{m.3}}</b>中回复了您</a>
		                	{% endifequal %}

		                	{% ifequal m.4 6 %}
		                	<a href="javascript:void(0)" onclick="reOfTopic_page({{m.5}},{{m.2}},{{m.6}});">{{m.1}}在<b>{{m.3}}</b>中回复了您</a>
		                	{% endifequal %}

		                	{% ifequal m.4 7 %}
		                	<a href="javascript:void(0)" onclick="read(7,{{m.6}},{{m.2}},0);">{{m.1}}完成您的悬赏<b>{{m.3}}</b>,请到<b>您购买的课程中</b>查看</a>
		                	{% endifequal %}

		                	{% ifequal m.4 8 %}
		                	<a href="javascript:void(0)" onclick="read(8,{{m.6}},{{m.2}},0);">{{m.1}}在<b>{{m.3}}</b>中选择了您</a>
		                	{% endifequal %}

		                	{% ifequal m.4 9 %}
		                	<a href="javascript:void(0)" onclick="news_page({{m.2}},{{m.6}})">您的<b>{{m.3}}</b>获得了赞</a>
		                	{% endifequal %}
<!--<a href="{% url 'courses:thecourse' m.2 %}#course_{{m.5}}">-->
		                	{% ifequal m.4 10 %}
		                	<a href="javascript:void(0)" onclick="read(10,{{m.6}},{{m.2}},{{m.5}});">{{m.1}}在<b>{{m.3}}</b>中评论了您</a>
		                	{% endifequal %}

		                	{% ifequal m.4 11 %}
		                	<a href="javascript:void(0)" onclick="reward_page({{m.5}},{{m.2}},{{m.6}})">{{m.1}}在<b>{{m.3}}</b>中评论了您</a>
		                	{% endifequal %}

		                	{% ifequal m.4 12 %}
		                	<a href="javascript:void(0)" onclick="reOfTopic_page({{m.5}},{{m.2}},{{m.6}});">您在<b>{{m.3}}</b>中的回复获得了赞</a>
		                	{% endifequal %}

		                	{% ifequal m.4 13 %}
		                	<a href="javascript:void(0)" onclick="news_page({{m.2}},{{m.6}})">您在<b>{{m.3}}</b>中的回复获得了赞</a>
		                	{% endifequal %}

		                </li>
		                 {% endfor %}

		                 <li><a href="{% url 'users:warning' %}"><span style="font-size:12px;margin-left:20px;">查看全部提醒 >></span></a></li>
		</ul>
            </li>
            <!--<div style='width:180px;'><span style='font-size:10px'>{{k.0}}给您发了一条私信 : <i>{{k.1}}</i></span></div><div style='font-size:10px' class='pull-right'><a href='#'>回复</a></div><hr /><a href='javascript:void(0)' class='pull-right' style='font-size:8px'>查看更多 >></a>-->
            <li><a href="javascript:void(0)" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-reorder"></i></a>
            		<ul class="dropdown-menu">
		               {% ifequal info.status 1 %}
		                <li><a href="{% url 'users:teacherapply' %}"><i class="icon-check"></i> 申请权限</a></li>
		                {% else %}
		                <li><a href="{% url 'courses:coursecreate' %}"><i class="icon-check"></i> 创建课程</a></li>
		                {% endifequal %}
		                <li><a href="{% url 'users:home' info.user_id %}"><i class="icon-home"></i> 我的主页</a></li>
		                <li class="divider"></li>
		                <li><a href="{% url 'users:feedback' %}"><i class="icon-user-md"></i> 意见反馈</a></li>
		                <li class="divider"></li>
		                <li><a href="javascript:void(0)" onclick="logout()"><i class="icon-signout"></i> 登出</a></li>
		</ul>
            </li>
          </ul>
        </div><!--/.nav-collapse -->
      </div>
    </div>


    <!--
    <style>
		body{background-color:#A6E8DE;}
	</style> 
	-->
	<script type="text/javascript">
	function f(){
		document.getElementById('search').style.background="#FFFFFF"
	}
	function b(){
		document.getElementById('search').style.background="#D0D0E6"
	}
	$('#selectPartner').popover({html:true});




		
	var xmlHttp; 

	function createXMLRequest(){
		if(window.ActiveXObject){
			xmlHttp=new ActiveXObject("Microsoft.XMLHttp");
		} else if(window.XMLHttpRequest){
			xmlHttp=new XMLHttpRequest();
		}
	}
	function news_page(news_id,warning_id){
		createXMLRequest();                       
		var url="/users/warning_news_page/?news_id="+news_id+"&warning_id="+warning_id;
		xmlHttp.open("GET",url);
		xmlHttp.onreadystatechange=function(e){
			if(xmlHttp.readyState==4 && xmlHttp.status==200){
					page=xmlHttp.responseText;

					if(page){
						$("#havent").html($("#havent").html()-1);
			    		window.location.href='/users/?page='+page+'#news_'+news_id;

					}else{
						e.preventDefault();
			    		$.scojs_message('服务器出错啦～ ：）', $.scojs_message.TYPE_ERROR);
					} 
				} /*else {
					e.preventDefault();
			    	$.scojs_message('服务器有小怪兽在捣乱～我们正在尽力捕捉～ ：）', $.scojs_message.TYPE_ERROR);
				}*/
			};
			xmlHttp.send(); 
	}


	function reOfTopic_page(re_id,topic_id,warning_id){
		createXMLRequest();                       
		var url="/groups/warning_reOfTopic_page/?re_id="+re_id+"&topic_id="+topic_id+"&warning_id="+warning_id;
		xmlHttp.open("GET",url);
		xmlHttp.onreadystatechange=function(e){
			if(xmlHttp.readyState==4 && xmlHttp.status==200){
					page=xmlHttp.responseText;
					if(page){
						$("#havent").html($("#havent").html()-1);
			    		window.location.href='/groups/topic/'+topic_id+'?page='+page+'#dingwei_'+re_id;
			    		
					}else{
						e.preventDefault();
			    		$.scojs_message('服务器出错啦～ ：）', $.scojs_message.TYPE_ERROR);
					} 
				} /*else {
					e.preventDefault();
			    	$.scojs_message('服务器有小怪兽在捣乱～我们正在尽力捕捉～ ：）', $.scojs_message.TYPE_ERROR);
				}*/
			};
			xmlHttp.send(); 
	}

	function reward_page(re_id,reward_id,warning_id){
		createXMLRequest();                       
		var url="/rewards/warning_reOfReward_page/?re_id="+re_id+"&reward_id="+reward_id+"&warning_id="+warning_id;
		xmlHttp.open("GET",url);
		xmlHttp.onreadystatechange=function(e){
			if(xmlHttp.readyState==4 && xmlHttp.status==200){
					page=xmlHttp.responseText;
					if(page){
						$("#havent").html($("#havent").html()-1);
			    		window.location.href='/rewards/the/'+reward_id+'?page='+page+'#dingwei_'+re_id;
			    		
					}else{
						e.preventDefault();
			    		$.scojs_message('服务器出错啦～ ：）', $.scojs_message.TYPE_ERROR);
					} 
				} /*else {
					e.preventDefault();
			    	$.scojs_message('服务器有小怪兽在捣乱～我们正在尽力捕捉～ ：）', $.scojs_message.TYPE_ERROR);
				}*/
			};
			xmlHttp.send(); 
	}

	function read(status,warning_id,uncertain_id,dingwei_id){
		createXMLRequest(); 
		var url="/users/header_warning/?status="+status+"&warning_id="+warning_id+"&uncertain_id="+uncertain_id;
		xmlHttp.open("GET",url);
		xmlHttp.onreadystatechange=function(e){
			if(xmlHttp.readyState==4 && xmlHttp.status==200){
					re=xmlHttp.responseText;//alert(re);
					if(re){
						$("#havent").html($("#havent").html()-1);
						if(status==1){
							window.location.href='/users/manage/reward/';
						}if(status==2){
							window.location.href='/courses/types/tiny/course/lession/'+uncertain_id;
						}if(status==7){
							window.location.href='/users/manage/course/';
						}if(status==8){
							window.location.href='/rewards/the/'+uncertain_id;
						}if(status==10){
							window.location.href='/courses/types/tiny/course/lession/'+uncertain_id+'#course_'+dingwei_id;
						}

			    		
			    		
					}else{
						e.preventDefault();
			    		$.scojs_message('服务器出错啦～ ：）', $.scojs_message.TYPE_ERROR);
					} 
				} /*else {
					e.preventDefault();
			    	$.scojs_message('服务器有小怪兽在捣乱～我们正在尽力捕捉～ ：）', $.scojs_message.TYPE_ERROR);
				}*/
			};
			xmlHttp.send(); 
	}


	function mes_read(from_id){
		createXMLRequest(); 
		var url="/users/mes_read/?from_id="+from_id;
		xmlHttp.open("GET",url);
		xmlHttp.onreadystatechange=function(e){
			if(xmlHttp.readyState==4 && xmlHttp.status==200){
					re=xmlHttp.responseText;//alert(re);
					if(re){
						$("#havent").html($("#havent").html()-1);
						window.location.href='/users/mestalk/'+from_id;
			    		
					}else{
						e.preventDefault();
			    		$.scojs_message('服务器出错啦～ ：）', $.scojs_message.TYPE_ERROR);
					} 
				} /*else {
					e.preventDefault();
			    	$.scojs_message('服务器有小怪兽在捣乱～我们正在尽力捕捉～ ：）', $.scojs_message.TYPE_ERROR);
				}*/
			};
			xmlHttp.send(); 
	}


	
	</script>
